<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    //回调地狱：异步函数嵌套异步函数
    //需要解决回调地狱的原因：代码耦合度高，不方便维护和阅读
      console.log("请求A数据");
      setTimeout(() => {
        console.log("A数据请求成功");
        console.log("请求B数据");
        setTimeout(()=>{
            console.log("B数据请求成功");
            console.log("请求C数据");
            setTimeout(()=>{
            console.log("C数据请求成功");
            },1000)
        },1500)
      }, 2000);
    </script>
</body>
</html>